package demo2;

class MyArrays<T>{
    Object[] arr = new Object[10];

    public T getPos(int pos){
        return (T)arr[pos];
    }

    public void setPos(int pos, T x){
        this.arr[pos] = x;
    }

}

class Alg{
    public <T extends Comparable<T>> T findMax(T arr[]){
        T max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if(max.compareTo(arr[i])<0){
                T tmp = max;
                max = arr[i];
                arr[i] =tmp;
            }
        }
        return max;
    }
}

public class Text {
    public static void main(String[] args) {
        MyArrays<Integer> arrays = new MyArrays();
        arrays.setPos(0,11);
        arrays.setPos(1,10);
        int ret = arrays.getPos(0);
    }
}
